<?php
session_start();
?>
<center>
<br/><br/><br/><br/>
 <form action="<?php $_SERVER["PHP_SELF"]/*or logout.php */?>" method="post" >
 <table width="400">
    <tr>
        <td colspan=3 align=center>
                <h2><p style="color:blue">LOGOUT</font></p></h2>
        </td>
    </tr>
    <tr>
        <td colspan=3 align=center>          
            <input type="submit" value="Logout" name="submit">
        </td>        
    </tr>
    <tr>
        <td colspan=3 align=center>          
          <?php include("Libraries\BusinessLogic\member.php");
		  if(isset($_POST["submit"]) && isset($_SESSION["user"]))
		  {
		   echo "You are no longer logged in as ".$_SESSION['user'];
		   logout();
		  }
		  else if(isset($_POST["submit"]) && !isset($_SESSION["user"]))
		  {
			  echo "You must login first";
		  }
		  
	      ?>
        </td>
    </tr>
    
    <tr>
        <td colspan=3 align=center>          
        <a href="index.php"><p style="text-decoration:none"><h3>return</h3></style></a> 
        </td>
    </tr>
</table>
</form>